﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Andy.Web
{
    public partial class Site1 : System.Web.UI.MasterPage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                loadCauHinhTrangChu();
            }
        }
        protected string IsColor()
        {
            using (var chService = new CauHinhServiceReference.CauHinhServiceClient())
            {
                var ch = chService.ChiTietCauHinh();
                if (ch != null)
                {
                    return "background-color:" + ch.Text5;
                }
            }
            return "background-color:#FFFFFF";
        }
        public void loadCauHinhTrangChu()
        {
            using (var chService = new CauHinhServiceReference.CauHinhServiceClient())
            {
                var ch = chService.ChiTietCauHinh();
                if (ch != null)
                {
                    ltrTitle.Text = ch.Text2;
                    ltrTitleBanner.Text = ch.Text1;
                    //ltrTitleChiTiet.Text = ch.Text3;

                    //imgMuaHang.Src = ch.Image1;
                    Img_banner.Src = ch.Image2;
                }
            }
            //using (var spService = new SanPhamServiceReference.SanPhamServiceClient())
            //{
            //    var lstLoaiSanPham = spService.DanhSachLoaiSanPham();
            //    RptMenuLoaiSanPham.DataSource = lstLoaiSanPham;
            //    RptMenuLoaiSanPham.DataBind();
            //}
        }
    }
}